<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>Hello MUI</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<link rel="stylesheet" href="../css/mui.min.css">
		<script src="../js/mui.min.js"></script>
		<script src="../js/app.js"></script>
		<style>
			html,body {
				background-color: #efeff4;
			}
		</style>
		<script>
			mui.init();
		</script>
	</head>

	<body>

<div id="pullrefresh" class="mui-content mui-scroll-wrapper">
	<div class="mui-scroll">
		<ul id='list' class="mui-table-view mui-table-view-chevron">
			<li class="mui-table-view-cell">
				<a class="mui-navigate-right">
					Item 6
				</a>
			</li>
			<li class="mui-table-view-cell">
				<a class="mui-navigate-right">
					Item 5
				</a>
			</li>
			<li class="mui-table-view-cell">
				<a class="mui-navigate-right">
					Item 4
				</a>
			</li>
			<li class="mui-table-view-cell">
				<a class="mui-navigate-right">
					Item 3
				</a>
			</li>
			<li class="mui-table-view-cell">
				<a class="mui-navigate-right">
					Item 2
				</a>
			</li>
			<li class="mui-table-view-cell">
				<a class="mui-navigate-right">
					Item 1
				</a>
			</li>
		</ul>
	</div>
</div>
<script>
	mui.init({
		pullRefresh: {
			container: '#pullrefresh',
			down: {
				callback: pulldownRefresh
			}
		}
	});

	function pulldownRefresh() {
		var self = this;
		setTimeout(function() {
			var table = document.body.querySelector('.mui-table-view');
			var cells = document.body.querySelectorAll('.mui-table-view-cell');
			for (var i = cells.length, len = i + 3; i < len; i++) {
				var li = document.createElement('li');
				li.className = 'mui-table-view-cell';
				li.innerHTML = '<a class="mui-navigate-right">Item ' + (i + 1) + '</a>';
				table.insertBefore(li, table.firstChild);
			}
			//refresh completed 这行代码必须调用
			self.endPulldownToRefresh();
		}, 1000);
	}
</script>
</body>
</html>